package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.OrderContrastBusinessDetail;
import com.ruoyi.system.mapper.OrderContrastBusinessDetailMapper;
import com.ruoyi.system.service.IOrderContrastBusinessDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 返佣商户比例明细Service业务层处理
 *
 * @author hjf
 * @date 2025-06-06
 */
@Service
public class OrderContrastBusinessDetailServiceImpl implements IOrderContrastBusinessDetailService {
    @Autowired
    private OrderContrastBusinessDetailMapper orderContrastBusinessDetailMapper;

    /**
     * 查询返佣商户比例明细
     *
     * @param id 返佣商户比例明细主键
     * @return 返佣商户比例明细
     */
    @Override
    public OrderContrastBusinessDetail selectOrderContrastBusinessDetailById(Long id) {
        return orderContrastBusinessDetailMapper.selectOrderContrastBusinessDetailById(id);
    }

    /**
     * 查询返佣商户比例明细列表
     *
     * @param orderContrastBusinessDetail 返佣商户比例明细
     * @return 返佣商户比例明细
     */
    @Override
    public List<OrderContrastBusinessDetail> selectOrderContrastBusinessDetailList(OrderContrastBusinessDetail orderContrastBusinessDetail) {
        return orderContrastBusinessDetailMapper.selectOrderContrastBusinessDetailList(orderContrastBusinessDetail);
    }

    /**
     * 新增返佣商户比例明细
     *
     * @param orderContrastBusinessDetail 返佣商户比例明细
     * @return 结果
     */
    @Override
    public int insertOrderContrastBusinessDetail(OrderContrastBusinessDetail orderContrastBusinessDetail) {
        orderContrastBusinessDetail.setCreateTime(DateUtils.getNowDate());
        return orderContrastBusinessDetailMapper.insertOrderContrastBusinessDetail(orderContrastBusinessDetail);
    }

    /**
     * 修改返佣商户比例明细
     *
     * @param orderContrastBusinessDetail 返佣商户比例明细
     * @return 结果
     */
    @Override
    public int updateOrderContrastBusinessDetail(OrderContrastBusinessDetail orderContrastBusinessDetail) {
        return orderContrastBusinessDetailMapper.updateOrderContrastBusinessDetail(orderContrastBusinessDetail);
    }

    /**
     * 批量删除返佣商户比例明细
     *
     * @param ids 需要删除的返佣商户比例明细主键
     * @return 结果
     */
    @Override
    public int deleteOrderContrastBusinessDetailByIds(Long[] ids) {
        return orderContrastBusinessDetailMapper.deleteOrderContrastBusinessDetailByIds(ids);
    }

    /**
     * 删除返佣商户比例明细信息
     *
     * @param id 返佣商户比例明细主键
     * @return 结果
     */
    @Override
    public int deleteOrderContrastBusinessDetailById(Long id) {
        return orderContrastBusinessDetailMapper.deleteOrderContrastBusinessDetailById(id);
    }
}
